<template>
	<view>
		<view class="xinguan-view" v-for="(item,index) in list" :key="index">

			<text class="name">{{ item.phy_name }}</text>
			<view class="xinguan-order">
				<text>接种人:</text>
				<text>{{ item.name }}</text>
			</view>
			<view class="xinguan-order">
				<text>接种地点:</text>
				<text>{{ item.address }}</text>
			</view>
			<view class="xinguan-order">
				<text>预约时段:</text>
				<text>{{ item.phy_time }}</text>
			</view>
			<view class="xinguan-order">
				<text>下单时间:</text>
				<text>{{ item.time }}</text>
			</view>
			<view class="xinguan-order">
				<text>订单编号:</text>
				<text>{{ item.order_number }}</text>
			</view>
			<view class="reg-price">
				<text>¥{{ item.price }}</text>
			</view>
			<!-- 取消预约 -->
			<view class="reg-cancel">
				<text @click="no(item._id)" v-if="item.cancel">取消预约</text>
				<text class="prevent_style" v-if="!item.cancel">已取消预约</text>
			</view>
		</view>
		<!-- 提示组件 -->
		<!--	<空组件 />-->
		<view style="height:200rpx"></view>


	</view>
</template>
<style>
	@import url('../../static/common-style/vaccine.css');
</style>

<script>
	import {
		nuatacancel,
		nuatauserorder
	} from "../../utils/API/homeapi";

	export default {
		data() {
			return {
				list: []
			};
		},
		mounted() {
			this.xuan()
		},
		methods: {
			async xuan() {
				let {
					data
				} = await nuatauserorder()
				this.list = data
				console.log(this.list)
			},
			async no(id) {
				await nuatacancel(id)
				await this.xuan()
			}
		}
	}
</script>
